package de.codi.exception;

// TODO remove if never used

public class CodiException extends Exception {
	

	private String    m = null;
	private Exception e = null;

	/**
	* Constructs a CODI exception by specifying the error message.
	* 
	* @param message The message describing the exception.
	*/
	public CodiException(String message) {
		this.m = message;
	}
	
	
	/**
	* Constructs a CODI exception by specifying the caught exception.
	* 
	* @param exception The exception caught before this exception occured.
	*/
	public CodiException(Exception exception) {
		this.e = exception;
	}
	
	/**
	* Constructs a CODI exception by specifying the error message and
	* caught exception.
	* 
	* @param message The message describing the exception.
	* @param exception The exception caught before this exception occured.
	*/
	public CodiException(String message, Exception exception) {
		this.m = message;
		this.e = exception;
	}
	
	/**
	* Returns a human understandable string representation.
	* 
	* @return A string representation of this exception. 
	*/
	public String toString() {
		String repr = "\n";
		repr += "CodiException: \n";
		if (this.m != null) {
			repr += "Message: " + this.m;
		}
		if (this.e != null) {
			repr += "Exception: " + this.e.getStackTrace();
		}
		
		
		return repr;
	}


	
	private static final long serialVersionUID = 1L;	

}
